<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>好好吃零食商城</title>
<link type="text/css" href="css/css.css" rel="stylesheet" />

<script src="js/wb.js" type="text/javascript" charset="utf-8"></script>
 <script type="text/javascript" src="js/vue.js"></script>
 <script type="text/javascript" src="js/jquery.min.js"></script>
 <script type="text/javascript" src="js/js.js"></script>
 <script type="text/javascript">
  $(function(){
   $("#kinMaxShow").kinMaxShow();
  });
 </script>
</head>

<body>
 <div class="mianCont" id="app">
  <div class="top">
   <span >您好！欢迎来到好好吃零食商城</span>
   <span class="topRight">
    <a href="vip.html">好好吃</a>&nbsp;| 
    <a href="order.html">我的订单</a>&nbsp;| 
    <a href="vip.html">会员中心</a>&nbsp;|
    <a href="help.html">联系我们</a>
   </span>
  </div><!--top/-->
  <div class="lsg">
   <h1 class="logo"><a href="index.html"><img src="img/logo.png" width="217" height="90" /></a></h1>
   <div  class="subBox">
    <div class="subBoxDiv">
     <input type="text" class="subLeft" id="sub"/>
     <input type="image" id="sublert2" src="img/subimg.png" width="63" height="34" class="sub" />
     <div class="hotWord">
      热门搜索：
      <a href="#">辣条</a>&nbsp;
      <a href="#">大礼包</a> &nbsp;
      <a href="#">手撕面包</a>&nbsp;
      <a href="#">鸭脖</a>  &nbsp;
      <a href="#">每日坚果</a> &nbsp;
      <a href="#">芒果干</a>&nbsp;
     </div><!--hotWord/-->
    </div><!--subBoxDiv/-->
   </div><!--subBox/-->
   <div class="gouwuche">
    <div class="gouCar">
     <img src="img/gouimg.png" width="19" height="20" style="position:relative;top:6px;" />&nbsp;|&nbsp;
     <strong class="red">{{dod.length}}</strong>&nbsp;件&nbsp;|
     <strong class="red">￥ {{tot}}元</strong>
     <a href="order.html">去结算</a> <img src="img/youjian.jpg" width="5" height="8" />    
    </div><!--gouCar/-->
    <div class="myChunlv">
     <a href="vip.html"><img src="img/mychunlv.jpg" width="112" height="34" /></a>
    </div><!--myChunlv/-->
   </div><!--gouwuche/-->
  </div><!--lsg/-->
  <div class="pnt">
   <div class="pntLeft">
    <h2 class="Title">所有商品分类</h2>
    <ul class="InPorNav">
     <li><a href="product.html">镇店爆款</a>
       <div class="chilInPorNav" >
       <a href="#" v-for="item in goods"  v-if="item.type=='镇店爆款'"@click="gooou(item.id)"  >{{item.goodsName}}</a>
      </div>
     </li>
     <li><a href="product.html">量贩专区</a>

      <div class="chilInPorNav" >
       <a href="#" v-for="item in goods"v-if="item.type=='量贩专区'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
     <li><a href="product.html">坚果炒货</a>
      <div class="chilInPorNav" >
       <a href="#" v-for="item in goods"v-if="item.type=='坚果炒货'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
     <li><a href="product.html">肉类卤味</a>
      <div class="chilInPorNav" id="roulei">
       <a href="#" v-for="item in goods"v-if="item.type=='肉类卤味'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
     <li><a href="product.html">干果蜜钳</a>
      <div class="chilInPorNav" >
       <a href="#" v-for="item in goods"v-if="item.type=='干果蜜钳'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
     <li><a href="product.html">糕点点心</a>
      <div class="chilInPorNav" >
       <a href="#" v-for="item in goods" v-if="item.type=='糕点点心'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
     <li><a href="product.html">方便素食</a>
      <div class="chilInPorNav" >
       <a href="#" v-for="item in goods"v-if="item.type=='方便素食'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
     <li><a href="product.html">冲饮茶饮</a>
      <div class="chilInPorNav">
       <a href="#" v-for="item in goods"v-if="item.type=='冲茶茶饮'"@click="gooou(item.id)">{{item.goodsName}}</a>
      </div><!--chilLeftNav/-->
     </li>
    </ul><!--InPorNav/-->
   </div><!--pntLeft/-->
   <div class="pntRight">
    <ul class="nav">
     <li class="navCur"><a href="index.html">商城首页</a></li>
     <li><a href="product.html">商品中心</a></li>
     <li><a href="vip.html">会员中心</a></li>
     <li><a href="help.html">帮助中心</a></li>
     <div class="clears"></div>
     <div class="phone">TEL：001-12345678</div>
    </ul><!--nav/-->
    <div class="banner">
     <div id="kinMaxShow">
      <div>
       <a href="#"><img src="img/tui01.JPG" height="360"  /></a>
      </div> 		
      <div>
       <a href="#"><img src="img/ban4.jpg" height="360"  /></a>
      </div>
      <div>
       <a href="#"><img src="img/tui02.JPG" height="360"  /></a>
      </div>
      <div>
       <a href="#"><img src="img/tui03.JPG" height="360"  /></a>
      </div>
     </div><!--kinMaxShow/-->
    </div><!--banner/-->
   </div><!--pntRight/-->
   <div class="clears"></div>
  </div><!--pnt/-->
  <div class="rdPro">
   <div class="rdLeft">
    <ul class="rdList">
     <li>镇店爆款</li>
     <li>量贩专区</li>
     <div class="clears"></div>
    </ul><!--rdList/-->


    <div class="rdProBox" >
     <dl v-for="item in goods"v-if="item.type=='镇店爆款'"@click="gooou(item.id)">
      <dt><a href="proinfo.html"><img  v-bind:src="item.goodsImg" width="132" height="129" /></a></dt>
      <dd>{{item.goodsDetails}}</dd>
      <dd class="cheng">价格：{{item.goodsPrice}}</dd>
     </dl>
    </div>



    <div class="rdProBox" >
     <dl v-for="item in goods"v-if="item.type=='量贩专区'"@click="gooou(item.id)">
      <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129" /></a></dt>
      <dd>{{item.goodsDetails}}</dd>
      <dd class="cheng">价格：{{item.goodsPrice}}</dd>
     </dl>
     <div class="clears"></div>
    </div><!--rdPro/-->
   </div><!--rdLeft/-->
   <div class="rdRight">
    <img src="img/tui02.JPG" width="221" height="254" />
   </div><!--rdRight/-->
   <div class="clears"></div>
  </div><!--rdPro/-->


  <div class="hengfu">
   <img src="img/hengfu1.jpg" width="979" height="97" />
  </div><!--hengfu/-->

  <div class="floor" id="floor1">
   <h3 class="floorTitle">
   1F&nbsp;&nbsp;&nbsp;&nbsp;坚果炒货
   <a href="product.html" class="more">更多 &gt;</a>
   </h3>
   <div class="floorBox">
     <div class="frProList">
      <dl v-for="item in goods"v-if="item.type=='坚果炒货'"@click="gooou(item.id)">
       <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129"/></a></dt>
       <dd>{{item.goodsDetails}}</dd>
       <dd class="cheng">价格：{{item.goodsPrice}}</dd>
      </dl>
    </div><!--floorRight/-->
  </div><!--floor/-->
  </div>

  <div class="hengfu">
   <img src="img/tiaofu2.jpg" width="978" height="97" />
  </div><!--hengfu/-->


   <div class="floor" >
    <h3 class="floorTitle">
     2F&nbsp;&nbsp;&nbsp;&nbsp;肉类卤味
     <a href="product.html" class="more">更多 &gt;</a>
    </h3>
    <div class="floorBox">
      <div class="frProList">
       <dl v-for="item in goods"v-if="item.type=='肉类卤味'"@click="gooou(item.id)">
        <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129"/></a></dt>
        <dd>{{item.goodsDetails}}</dd>
        <dd class="cheng">价格：{{item.goodsPrice}}</dd>
       </dl>
       <div class="clears"></div>
      </div><!--frProList-->
     <div class="clears"></div>
    </div><!--floorBox/-->
   </div><!--floor/-->


   <div class="floor" >
    <h3 class="floorTitle">
     3F&nbsp;&nbsp;&nbsp;&nbsp;干果蜜钳
     <a href="product.html" class="more">更多 &gt;</a>
    </h3>
    <div class="floorBox">
      <div class="frProList">
       <dl v-for="item in goods"v-if="item.type=='干果蜜钳'"@click="gooou(item.id)">
        <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129"/></a></dt>
        <dd>{{item.goodsDetails}}</dd>
        <dd class="cheng">价格：{{item.goodsPrice}}</dd>
       </dl>
       <div class="clears"></div>
      </div><!--frProList-->
     <div class="clears"></div>
    </div><!--floorBox/-->
   </div><!--floor/-->


   <div class="floor" >
    <h3 class="floorTitle">
     4F&nbsp;&nbsp;&nbsp;&nbsp;糕点点心
     <a href="product.html" class="more">更多 &gt;</a>
    </h3>
    <div class="floorBox">
     <div class="frProList">
      <dl v-for="item in goods"v-if="item.type=='糕点点心'"@click="gooou(item.id)">
       <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129"/></a></dt>
       <dd>{{item.goodsDetails}}</dd>
       <dd class="cheng">价格：{{item.goodsPrice}}</dd>
      </dl>
     </div><!--frProList-->
     <div class="clears"></div>
    </div><!--floorBox/-->
   </div><!--floor/-->


  <div class="floor" >
  <h3 class="floorTitle">
   5F&nbsp;&nbsp;&nbsp;&nbsp;方便素食
   <a href="product.html" class="more">更多 &gt;</a>
  </h3>
  <div class="floorBox">
   <div class="frProList">
    <dl v-for="item in goods"v-if="item.type=='方便素食'"@click="gooou(item.id)">
     <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129"/></a></dt>
     <dd>{{item.goodsDetails}}</dd>
     <dd class="cheng">价格：{{item.goodsPrice}}</dd>
    </dl>
   </div><!--frProList-->
   <div class="clears"></div>
  </div><!--floorBox/-->
 </div><!--floor/-->

  <div class="floor" >
   <h3 class="floorTitle">
    6F&nbsp;&nbsp;&nbsp;&nbsp;冲茶茶饮
    <a href="product.html" class="more">更多 &gt;</a>
   </h3>
   <div class="floorBox">
    <div class="frProList">
     <dl v-for="item in goods"v-if="item.type=='冲茶茶饮'"@click="gooou(item.id)">
      <dt><a href="proinfo.html"><img v-bind:src="item.goodsImg" width="132" height="129"/></a></dt>
      <dd>{{item.goodsDetails}}</dd>
      <dd class="cheng">价格：{{item.goodsPrice}}</dd>
     </dl>
    </div><!--frProList-->
    <div class="clears"></div>
   </div><!--floorBox/-->
  </div><!--floor/-->
  <div class="inHelp">
   <div class="inHLeft">
    <h4>帮助中心</h4>
    <ul class="inHeList">
     <li><a href="help.html">购物指南</a></li>
     <li><a href="help.html">支付方式</a></li>
     <li><a href="help.html">售后服务</a></li>
     <li><a href="help.html">企业简介</a></li>
     <div class="clears"></div>
    </ul><!--inHeList/-->
   </div><!--inHLeft/-->
   <div class="inHLeft">
    <h4>会员服务</h4>
    <ul class="inHeList">
     <li><a href="reg.html">会员注册</a></li>
     <li><a href="login.html">会员登录</a></li>
     <li><a href="order.html">购物车</a></li>
     <li><a href="order.html">我的订单</a></li>
     <div class="clears"></div>
    </ul><!--inHeList/-->
   </div><!--inHLeft/-->
   <div class="inHRight">
    <h4>全国统一免费服务热线</h4>
    <div class="telBox">400-0000-0000</div>

   </div><!--inHRight/-->
   <div class="clears"></div>
  </div><!--inHelp/-->
  <div class="footer">
   <p>
   <a href="http://www.schhc.com">好好吃官网</a>&nbsp;|&nbsp;
   <a href="index.html">商城首页</a>&nbsp;|&nbsp;
   <a href="product.html">商品中心</a>&nbsp;|&nbsp;
   <a href="order.html">我的订单</a>&nbsp;|&nbsp;
   <a href="https://news.sina.com.cn">新闻动态</a>&nbsp;|&nbsp;
   <a href="login.html">会员中心</a>&nbsp;|&nbsp;
   <a href="help.html">帮助中心</a>
   </p>
   <p>
    版权所有：好好吃有限公司 版权所有  Copyright 2020-2025   ICP备00000000号
   </p>
  </div><!--footer/-->
  </div>

</div>

<script type="text/javascript" src="js/config.js"></script>
 <script type="text/javascript"src="js/jquery.cookie.js"></script>
<script type="text/javascript">


 var app=new Vue({
     el:"#app",
     data:{
         goods:[],
      dod:[],
      tot:0
     },
  methods:{
      gooou(id){
      $.cookie('name', id,{path:'/proinfo.html'});
       $(window).attr('location', 'proinfo.html');

      }
  }
 })
    //加载页面自动执行
 $(document).ready(function () {
        $.ajax({
            url:config.GOODS_GETALL,
            type:"post",
            dataType:"json",
            data:{
            },
            success:function (data) {
           app.goods=data.data
             }
        })

  //购物车查询
  $.ajax({
   url: config.CAR_GETBYXH,
   type: "post",
   dataType: "json",
   data: {
    "userXh": name

   },
   success: function (data) {
    app.dod = data.data
    for (i = 0; i < app.dod.length; i++) {
     app.tot = app.tot + parseInt(app.dod[i].goodsPrice) * parseInt(app.dod[i].carNum)

    }
   }

  })


 })
 $('#sublert2').click(function (){


  $.ajax({
   url:config.GOODS_GETALL,
   type:"post",
   dataType:"json",
   data:{
    "value":$("#sub").val()
   },
   success:function (data) {



    if (data.data==""){
     alert("没有此商品")
    }else {
      var id=data.data[0].id;
     $.cookie('name',id,{path:'/proinfo.html'});
     $(window).attr('location', 'proinfo.html');
    }



   }



  })
 })


</script>
</body>
</html>
